﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Salary.Sys.Core.Infrastructure
{
    public struct Issue
    {
        public int Year { get; set; }
        public int Month { get; set; }

        public Issue(int year, int month)
        {
            Year = year;
            Month = month;
        }

        public Issue(int issue)
        {
            Year = issue / 100;
            Month = issue % 100;
        }

        public static implicit operator int(Issue issue)
        {
            return issue.Year * 100 + issue.Month;
        }

        public static implicit operator Issue(int value)
        {
            return new Issue(value);
        }

        public override string ToString()
        {
            return (Year * 100 + Month).ToString();
        }
    }
}
